() => {
    //1.接口泛型的使用
    interface objType<T> {
        name: string
        age: number
        height: T
    }
    const obj: objType<string> = {
        name: "张三",
        age: 20,
        height: "180cm"
    }


    const obj2: objType<number> = {
        name: "李四",
        age: 10,
        height: 200
    }


    //2.多个泛型
    interface personType<T, K> {
        name: string
        age: number
        height: T
        weight: K
    }
    const person: personType<string, number> = {
        name: "王五",
        age: 19,
        height: "170cm",
        weight: 130
    }

    //
    //3.泛型约束
    //data是泛型T传递的  但是我要求T必须是一个对象类型
    interface axiosData<T extends object, K extends number | string> {
        status: K
        message: string
        data: T
    }
    const data1: axiosData<string[], string> = {
        status: "200",
        message: "ok",
        data: []
    }
}
